package com.yescall.mole;

import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.FPSLogger;
import com.badlogic.gdx.graphics.GL10;
import com.yescall.mole.screen.SplashScreen;

public class MoleGame extends Game {
	
	FPSLogger fpsLogger;
	
	@Override
	public void create() {		
		Gdx.app.log( "game", "Creating game" );
        fpsLogger = new FPSLogger();
	}

	@Override
	public void dispose() {

	}

	@Override
	public void render() {		
		super.render();
        // output the current FPS
        fpsLogger.log();
        
		//Gdx.gl.glClearColor(1, 1, 1, 1);
		//Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
	}

	@Override
	public void resize(int width, int height) {
		super.resize( width, height );
        // show the splash screen when the game is resized for the first time;
        // this approach avoids calling the screen's resize method repeatedly
        if( getScreen() == null ) {
            setScreen( getSplashScreen());
        }
	}

	@Override
	public void pause() {
		
	}

	@Override
	public void resume() {
		super.resume();
	}
	
	
	public SplashScreen getSplashScreen()
    {
        return new SplashScreen(this);
    }
	
	@Override
    public void setScreen(Screen screen)
    {
        super.setScreen( screen );
    }
}
